import { saveOrUpdate } from './api'
import { ListVO } from './data'

// 新增
export const add = async (formData: ListVO) => {
  const { username, password, nickname, avatarUrl , role, status } = formData
  const res = await saveOrUpdate({ username, password, nickname, avatarUrl , role, status })
  return res.code === 0
}
// 更新
export const update = async (formData: ListVO) => {
  const { id, username, password, nickname, avatarUrl , role, status } = formData
  const res = await saveOrUpdate({ id, username, password, nickname, avatarUrl , role, status })
  return res.code === 0
}
